<template>
  <div>
    <h2>我是孙</h2>
    <h5>{{ count }}</h5>
    <hr />
  </div>
</template>

<script>
import PubSub from "pubsub-js";
export default {
  name: "Tab",
  data() {
    return {
      count: 0,
    };
  },
  mounted(){
    PubSub.subscribe("yinwei",(_,yinwei)=>{
        this.count = yinwei
    })
  }
};
</script>

<style>
</style>